package com.rxh.mapper.core;

import com.rxh.mapper.base.BaseMapper;
import com.rxh.pojo.base.SearchInfo;
import com.rxh.pojo.core.CoreCardholder;
import com.rxh.pojo.core.CoreOrder;
import com.rxh.pojo.core.CoreOrderDetail;
import com.rxh.vo.VoCoreOrder;
import com.rxh.vo.VoCoreOrderExport;
import com.rxh.vo.VoOrderStatistics;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface CoreOrderMapper extends BaseMapper<CoreOrder, Long> {

    List<VoCoreOrder> selectOrderBySearchInfo(SearchInfo searchInfo);

    List<CoreOrder> selectMerchantOrderBySearchInfo(SearchInfo searchInfo);

    VoOrderStatistics selectOrderStatistics(SearchInfo searchInfo);

    VoOrderStatistics selectOrderBondStatistics(SearchInfo searchInfo);

    List<Map<String, Object>> selectCurrencyStatistics(SearchInfo searchInfo);

    List<Map<String, Object>> selectCountByStatus(@Param("searchInfo") SearchInfo searchInfo, @Param("status") Short status);

    Integer selectMerIdByOrderId(Long orderId);

    List<VoCoreOrderExport> selectBySearchInfoForExport(SearchInfo searchInfo);

    Integer selectCountBySearchInfo(SearchInfo searchInfo);

    List<VoCoreOrder> getSettlePlusOrderList(VoCoreOrder order);

    List<VoCoreOrder> getNoSettlePlusOrderList(VoCoreOrder order);

    List<VoCoreOrder> getDeductPlusOrderList(VoCoreOrder order);

    List<VoCoreOrder> getBondPlusOrderList(VoCoreOrder order);

    List<VoCoreOrder> getNoBondPlusOrderList(VoCoreOrder order);

    List<VoCoreOrder> selectBondInfo(SearchInfo searchInfo);

    List<VoCoreOrder> selectBondInfoForExport(SearchInfo searchInfo);

    Boolean updateOrder(Map<String,Object> paramMap);

    int selectByOrderSiteId(int siteId);

    List<Map<String,Object>> selectByLogisticsMgmtInfo(SearchInfo searchInfo);

    List<VoCoreOrderExport> getExportLogisticsMgmtInfo(SearchInfo searchInfo);

    int batchUpdateOrdersShipstatus(List<Map<String, Object>> recodes);

    BigDecimal selectRmbAmountBySearchInfo(SearchInfo searchInfo);

    CoreOrder selectByMerchantIdAndMerchantOrderId(@Param("merchantId") Integer merchantId,@Param("merchantOrderId") String merchantOrderId);

    List<Map<String,Object>> getCountCoreOrder(@Param("CoreOrder") CoreOrder coreOrder);

    List<Map<String,Object>> getCountCoreCardHolder(@Param("CoreOrder") CoreOrder coreOrder, @Param("CoreCardholder") CoreCardholder coreCardholder);

    List<Map<String,Object>> getCountCardHolderId(@Param("CoreOrder") CoreOrder coreOrder,@Param("CoreOrderDetail") CoreOrderDetail coreOrderDetail);

}